package forms;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;
import javax.swing.border.TitledBorder;
import javax.swing.UIManager;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.GridLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JList;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;

public class CreateTrainingPlanFrame extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					CreateTrainingPlanFrame frame = new CreateTrainingPlanFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public CreateTrainingPlanFrame() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 324);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u521B\u5EFA\u57F9\u8BAD\u8BA1\u5212", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
		panel.setBounds(10, 10, 414, 93);
		contentPane.add(panel);
		panel.setLayout(null);
		
		JLabel label_3 = new JLabel("\u7ED3\u675F\u65F6\u95F4");
		label_3.setBounds(209, 68, 61, 15);
		panel.add(label_3);
		
		textField_2 = new JTextField();
		textField_2.setBounds(99, 34, 100, 21);
		panel.add(textField_2);
		textField_2.setColumns(10);
		
		JLabel label_2 = new JLabel("\u5F00\u59CB\u65F6\u95F4");
		label_2.setBounds(28, 68, 61, 15);
		panel.add(label_2);
		
		textField_1 = new JTextField();
		textField_1.setBounds(99, 65, 100, 21);
		panel.add(textField_1);
		textField_1.setColumns(10);
		
		JLabel label_1 = new JLabel("\u540D\u79F0");
		label_1.setBounds(209, 37, 35, 15);
		panel.add(label_1);
		
		textField_3 = new JTextField();
		textField_3.setBounds(288, 34, 100, 21);
		panel.add(textField_3);
		textField_3.setColumns(10);
		
		textField = new JTextField();
		textField.setBounds(288, 65, 100, 21);
		panel.add(textField);
		textField.setColumns(10);
		
		JLabel label = new JLabel("\u5E74\u5EA6");
		label.setBounds(28, 37, 35, 15);
		panel.add(label);
		
		JButton button = new JButton("\u4FDD\u5B58");
		button.setBounds(312, 10, 66, 23);
		panel.add(button);
		
		JButton button_1 = new JButton("\u589E\u52A0");
		
		button_1.setBounds(272, 113, 62, 23);
		contentPane.add(button_1);
		
		JButton button_2 = new JButton("\u5220\u9664");
		button_2.setBounds(349, 113, 62, 23);
		contentPane.add(button_2);
		
		final JPanel panel_1 = new JPanel();
		panel_1.setBounds(10, 150, 397, 125);
		contentPane.add(panel_1);
		int  counterRow = 2;
		final GridLayout layout = new GridLayout(counterRow, 5, 5, 5);
		panel_1.setLayout(layout);
		
		JLabel lblPp = new JLabel("\u4E13\u4E1A");
		lblPp.setBounds(1, 0, 75, 39);
		panel_1.add(lblPp);
		
		JLabel lblPpp = new JLabel("\u57F9\u8BAD\u76EE\u7684");
		lblPpp.setBounds(81, 0, 75, 39);
		panel_1.add(lblPpp);
		
		JLabel lblPpp_1 = new JLabel("\u57F9\u8BAD\u5185\u5BB9");
		lblPpp_1.setBounds(161, 0, 75, 39);
		panel_1.add(lblPpp_1);
		
		JLabel lblNewLabel = new JLabel("\u8BFE\u65F6");
		lblNewLabel.setBounds(241, 0, 75, 39);
		panel_1.add(lblNewLabel);
		
		JLabel label_4 = new JLabel("\u6388\u8BFE\u4EBA");
		label_4.setBounds(321, 0, 75, 39);
		panel_1.add(label_4);
		
		JComboBox comboBox = new JComboBox();
		comboBox.setModel(new DefaultComboBoxModel(new String[] {"\u7535\u6C14", "\u710A\u63A5"}));
		comboBox.setBounds(10, 61, 44, 21);
		panel_1.add(comboBox);
		
		JList list = new JList();
		list.setBounds(81, 35, 75, 80);
		panel_1.add(list);
		
		JList list_1 = new JList();
		list_1.setBounds(161, 35, 75, 80);
		panel_1.add(list_1);
		
		JList list_2 = new JList();
		list_2.setBounds(241, 63, 65, 22);
		panel_1.add(list_2);
		
		JList list_3 = new JList();
		list_3.setBounds(316, 63, 65, 22);
		panel_1.add(list_3);
		
		button_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				layout.setRows(layout.getRows()+1);
				panel_1.setLayout(layout);
				JComboBox comboBox = new JComboBox();
				comboBox.setModel(new DefaultComboBoxModel(new String[] {"\u7535\u6C14", "\u710A\u63A5"}));
				comboBox.setBounds(10, 61, 44, 21);
				panel_1.add(comboBox);
				
				JList list = new JList();
				list.setBounds(81, 35, 75, 80);
				panel_1.add(list);
				
				JList list_1 = new JList();
				list_1.setBounds(161, 35, 75, 80);
				panel_1.add(list_1);
				
				JList list_2 = new JList();
				list_2.setBounds(241, 63, 65, 22);
				panel_1.add(list_2);
				
				JList list_3 = new JList();
				list_3.setBounds(316, 63, 65, 22);
				panel_1.add(list_3);
			}
		});
	}
}
